package com.edu.study.base.wordAttributeDetail.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.edu.study.base.wordAttributeDetail.mapper.WordAttributeDetailMapper;
import com.edu.study.base.wordAttributeDetail.domain.WordAttributeDetail;
import com.edu.study.base.wordAttributeDetail.service.IWordAttributeDetailService;

/**
 * 单词测试选项内容Service业务层处理
 * 
 * @author zw
 * @date 2021-08-02
 */
@Service
//@DataSource(value = DataSourceType.SLAVE)
public class WordAttributeDetailServiceImpl extends ServiceImpl<WordAttributeDetailMapper, WordAttributeDetail> implements IWordAttributeDetailService
{
    @Autowired
    private WordAttributeDetailMapper wordAttributeDetailMapper;

    /**
     * 查询单词测试选项内容
     * 
     * @param id 单词测试选项内容ID
     * @return 单词测试选项内容
     */
    @Override
    public WordAttributeDetail selectWordAttributeDetailById(Long id)
    {
        return wordAttributeDetailMapper.selectWordAttributeDetailById(id);
    }

    /**
     * 查询单词测试选项内容列表
     * 
     * @param wordAttributeDetail 单词测试选项内容
     * @return 单词测试选项内容
     */
    @Override
    public List<WordAttributeDetail> selectWordAttributeDetailList(WordAttributeDetail wordAttributeDetail)
    {
        return wordAttributeDetailMapper.selectWordAttributeDetailList(wordAttributeDetail);
    }

    /**
     * 新增单词测试选项内容
     * 
     * @param wordAttributeDetail 单词测试选项内容
     * @return 结果
     */
    @Override
    public int insertWordAttributeDetail(WordAttributeDetail wordAttributeDetail)
    {
        wordAttributeDetail.setCreateTime(DateUtils.getNowDate());
        return wordAttributeDetailMapper.insertWordAttributeDetail(wordAttributeDetail);
    }

    /**
     * 修改单词测试选项内容
     * 
     * @param wordAttributeDetail 单词测试选项内容
     * @return 结果
     */
    @Override
    public int updateWordAttributeDetail(WordAttributeDetail wordAttributeDetail)
    {
        wordAttributeDetail.setUpdateTime(DateUtils.getNowDate());
        return wordAttributeDetailMapper.updateWordAttributeDetail(wordAttributeDetail);
    }

    /**
     * 批量删除单词测试选项内容
     * 
     * @param ids 需要删除的单词测试选项内容ID
     * @return 结果
     */
    @Override
    public int deleteWordAttributeDetailByIds(Long[] ids)
    {
        return wordAttributeDetailMapper.deleteWordAttributeDetailByIds(ids);
    }

    /**
     * 删除单词测试选项内容信息
     * 
     * @param id 单词测试选项内容ID
     * @return 结果
     */
    @Override
    public int deleteWordAttributeDetailById(Long id)
    {
        return wordAttributeDetailMapper.deleteWordAttributeDetailById(id);
    }
}
